<!DOCTYPE html>
<html>
    <head>
      <meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
      <style>
           body{
               font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; font-size: 12px;
           }
          #users
          {
              font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
              width:100%;
              border-collapse:collapse;
          }
          #users td, #users th
          {
              font-size:1em;
              border:1px solid #98bf21;
              padding:3px 7px 2px 7px;
          }
          #users th
          {
              font-size:1.1em;
              text-align:left;
              padding-top:5px;
              padding-bottom:4px;
              background-color:#A7C942;
              color:#ffffff;
          }
          #users tr.alt td
          {
              color:#000000;
              background-color:#EAF2D3;
          }
          #footer { font-size:11px; color:#555555; text-align: center; }
      </style>
    </head>

    <body style="font-family:'Trebuchet MS',sans-serif; font-size: 12px;">
    <div>
      <img style="width:100px; height:72px; " src="http://noisetube.net/images/cartasur_v0.png">
      <img style="font-weight: 400; margin-top: 40px; width:295px; height:45px; " src="http://noisetube.net/images/cartasur-text.png">
    </div>
    <div>
        <h3>Noisetube - Cartasur Weekly Report</h3>

        <% if @info.size == 0 %>
        <p>
          No contributions recorded in the last week.
        </p>
        <% else %>
          <table id="users" style=" font-family: 'Trebuchet MS', sans-serif; width:100%; border-collapse:collapse;">
              <tr>
                <th>User</th>
                <th>Protocols this week</th>
                <th>Locations</th>
               </tr>
              <% count = 0

                 @info.each {| data|

                  count = count + 1
              %>
                <tr style="font-size:1em; border:1px solid #98bf21; padding:3px 7px 2px 7px;<%= count.even? ? " color:#000000; background-color:#EAF2D3;" : "" %>" >
                    <td>
                       <%=  data[:user] %>
                    </td>
                    <td>
                      <%= data[:protocols] %>
                    </td>
                    <td>
                      <% data[:info].each do | info| %>
                        <%= info[:location] %>  |  <%= info[:measures].try(:to_s) << " measures" %> <br />
                      <% end %>

                    </td>
                </tr>
            <%  } %>
          </table>
          <% end %>
    </div>
        <hr />
    <div id="footer" style="font-size:11px; color:#555555; text-align: center;">
      <p>&copy;2013-2014 <a href='<%= @url %>'>Cartasur Project</a>. Please do not reply to this e-mail</p>
    </div>
    </body>
</html>
